/*
 * cdatamodel.c - Print C data model (output in CSV)
 * Inspiration: Programming Pearls, 2nd edition. 7.2 Performance Estimates
 * Copyright (c) 2010-2011 Rudá Moura <ruda.moura@gmail.com> 
 */

#include <stdio.h>

int
main(void)
{
	puts("C Data Type,Bytes,Bits");
	printf("pointer,%d,%d\n",
	       (int) sizeof(void *),
	       (int) sizeof(void *) * 8);
	printf("char,%d,%d\n",
	       (int) sizeof(char),
	       (int) sizeof(char) * 8);
	printf("short,%d,%d\n",
	       (int) sizeof(short),
	       (int) sizeof(short) * 8);
	printf("int,%d,%d\n",
	       (int) sizeof(int),
	       (int) sizeof(int) * 8);
	printf("long,%d,%d\n",
	       (int) sizeof(long),
	       (int) sizeof(long) * 8);
	printf("long long,%d,%d\n",
	       (int) sizeof(long long),
	       (int) sizeof(long long) * 8);
	printf("float,%d,%d\n",
	       (int) sizeof(float),
	       (int) sizeof(float) * 8);
	printf("double,%d,%d\n",
	       (int) sizeof(double),
	       (int) sizeof(double) * 8);
	printf("long double,%d,%d\n",
	       (int) sizeof(long double),
	       (int) sizeof(long double) * 8);
	return 0;
}
